<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--select  distinct o.COMPANY_NAME AS COMPANY_NAME, substation_name AS SUB_NAME, distline_name AS PSR_NAME, 1 AS PSR_ID,'DFDistributionTransformer' AS PSR_TYPE, '导线截面异常' AS JUDGE_TYPE , '技术降损评价中心' JUDGE_SOURCE,  'PMS ' AS DATA_SOURCE, '5' AS VOLTAGE, '10' AS JUDGE_ID , o.pms_obj_id AS OBJ_ID ,o.COMPANY_ID AS COMPANY_ID from ODS_PIA_DISTLINERADIUSOVER o ,COC_COMPANYRELATION c where o.COMPANY_ID=c.COMPANY_ID and (o.COMPANY_ID = #{companyId} or c.PARENT_ID = #{companyId})-->
<!--union all-->






<!--select company_name,-->
<!--sub_name,-->
<!--psr_name,-->
<!--psr_id,-->
<!--psr_type,-->
<!--to_char(wm_concat(judge_type)) judge_type,-->
<!--to_char(wm_concat(judge_source)) judge_source,-->
<!--to_char(wm_concat(data_source)) data_source,-->
<!--voltage,-->
<!--to_char(wm_concat(judge_id)) judge_id,-->
<!--obj_id,-->
<!--company_id,-->
<!--xh-->
<!--from (select s.company_name,-->
<!--s.sub_name,-->
<!--s.psr_name,-->
<!--s.psr_id,-->
<!--s.psr_type,-->
<!--to_char(wm_concat(s.judge_type)) judge_type,-->
<!--s.voltage,-->
<!--to_char(wm_concat(s.judge_id)) judge_id,-->
<!--s.obj_id,-->
<!--s.company_id,-->
<!--judge_source,-->
<!--data_source,-->
<!--sum(xh) xh-->
<!--from smp_summary202012 s-->
<!--where s.psr_type = #{psr_type}-->
<!--and s.voltage = #{voltage}-->
<!--and s.company_id = #{company_id}-->
<!--group by s.obj_id,-->
<!--s.company_id,-->
<!--s.voltage,-->
<!--s.psr_id,-->
<!--s.psr_type,-->
<!--s.company_name,-->
<!--s.sub_name,-->
<!--s.psr_name,-->
<!--s.judge_source,-->
<!--s.data_source)-->
<!--group by obj_id,-->
<!--company_id,-->
<!--voltage,-->
<!--psr_id,-->
<!--psr_type,-->
<!--company_name,-->
<!--sub_name,-->
<!--psr_name-->






<!--select company_name,-->
<!--sub_name,-->
<!--psr_name,-->
<!--psr_id,-->
<!--psr_type,-->
<!--judge_type,-->
<!--judge_source,-->
<!--data_source,-->
<!--voltage,-->
<!--judge_id,-->
<!--obj_id,-->
<!--company_id,-->
<!--xh-->
<!--from (select company_name,-->
<!--sub_name,-->
<!--psr_name,-->
<!--psr_id,-->
<!--psr_type,-->
<!--to_char(wm_concat(judge_type)) judge_type,-->
<!--to_char(wm_concat(judge_source)) judge_source,-->
<!--to_char(wm_concat(data_source)) data_source,-->
<!--voltage,-->
<!--to_char(wm_concat(judge_id)) judge_id,-->
<!--obj_id,-->
<!--company_id,-->
<!--sum(xh) xh-->
<!--from (select s.company_name,-->
<!--s.sub_name,-->
<!--s.psr_name,-->
<!--s.psr_id,-->
<!--s.psr_type,-->
<!--to_char(wm_concat(s.judge_type)) judge_type,-->
<!--s.voltage,-->
<!--to_char(wm_concat(s.judge_id)) judge_id,-->
<!--s.obj_id,-->
<!--s.company_id,-->
<!--judge_source,-->
<!--data_source,-->
<!--sum(xh) xh-->
<!--from smp_summary202012 s-->
<!--where s.company_id = #{company_id}-->
<!--and s.psr_type = #{psr_type}-->
<!--and s.voltage = #{voltage}-->
<!--group by s.obj_id,-->
<!--s.company_id,-->
<!--s.voltage,-->
<!--s.psr_id,-->
<!--s.psr_type,-->
<!--s.company_name,-->
<!--s.sub_name,-->
<!--s.psr_name,-->
<!--s.judge_source,-->
<!--s.data_source)-->
<!--group by obj_id,-->
<!--company_id,-->
<!--voltage,-->
<!--psr_id,-->
<!--psr_type,-->
<!--company_name,-->
<!--sub_name,-->
<!--psr_name)-->
<!--order by xh desc-->



<!--持续重载-->

<!--select round(ol.AMP_RATING,2) as rating,-->
<!--to_char(to_date(oe.STARTDATE),'mm')||'月'||to_char(to_date(oe.STARTDATE),'dd')||'日' as startDate ,-->
<!--to_char(to_date(oe.ENDDATE),'mm')||'月'||to_char(to_date(oe.ENDDATE),'dd')||'日' as endDate,-->
<!--replace(wm_concat(to_char(to_date(ol.MAX_I_TIME,'yyyy-mm-dd hh24:mi:ss'),'hh24')||'时（' || round(ol.MAX_I,2) || 'A）' ),',','、') as hourAndEleStr,-->
<!--replace(wm_concat(round(ol.MAX_LOAD_RATE,2) || '%'),',','、') as loadRateStr,-->
<!--LINE_NAME as lineName,-->
<!--WIRETYPE_CODE as lineType-->
<!--from ODS_LMS_LINEDETAIL202012 ol,ODS_LMS_EQUIPDURATION oe-->
<!--where ol.LINE_ID = oe.PSRID and  ol.PMS_OBJ_ID = #{objId}-->
<!--group by ol.AMP_RATING,oe.STARTDATE,oe.ENDDATE,ol.MAX_LOAD_RATE,ol.LINE_NAME,ol.WIRETYPE_CODE-->


<!--<select id="getDistLineAlwaysVO" resultType="com.ly.report_ah.vo.DistLineAlwaysLoadVo">-->
<!--select ld.DISTLINE_NAME lineName,ld.WIRETYPE_CODE lineType,round(ld.AMP_RATING,2) rating , ld.PMS_OBJ_ID,-->
<!--to_char(to_date(le.STARTDATE),'mm')||'月'||to_char(to_date(le.STARTDATE),'dd')||'日' startTime,-->
<!--to_char(to_date(le.ENDDATE),'mm')||'月'||to_char(to_date(le.ENDDATE),'dd')||'日' endTime,-->
<!--replace(wm_concat(to_char(to_date(ld.MAX_I_TIME,'yyyy-mm-dd hh24:mi:ss'),'hh24')||'时（' || round(ld.MAX_I,2) || 'A）' ),',','、') hourAndEleStr,-->
<!--replace(wm_concat(round(ld.MAX_LOAD_RATE,2) || '%'),',','、') loadRateStr-->
<!--from ODS_LMS_DISTLINEDETAIL202012 ld ,ODS_LMS_EQUIPDURATION le-->
<!--where ld.DISTLINE_ID=le.PSRID and ld.PMS_OBJ_ID= #{objId}-->
<!--group by ld.DISTLINE_NAME,ld.WIRETYPE_CODE,ld.AMP_RATING,le.STARTDATE,le.ENDDATE,ld.PMS_OBJ_ID-->


<!--<select id="getTranAlwaysLoad" resultType="com.ly.report_ah.vo.TranLoadAlwaysVO">-->
<!--    select to_char(to_date(STARTDATE),'mm')||'月'||to_char(to_date(STARTDATE),'dd')||'日' startTime ,to_char(to_date(ENDDATE),'mm')||'月'||to_char(to_date(ENDDATE),'dd')||'日' endTime , round(ot.CAP,2) cap,-->
<!--    to_char(replace(wm_concat(to_char(to_date(ot.MAX_P_TIME,'yyyy-mm-dd hh24:mi:ss'),'hh24')||'时（' || round(ot.MAX_P ,2)|| 'MW）' ),',','、')) timeAndRate ,-->
<!--    replace(to_char(wm_concat(round(ot.MAX_LOAD_RATE,2) || '%')),',','，') loadRateStr  from ODS_LMS_TRANDETAIL202012 ot , ODS_LMS_EQUIPDURATION oe-->
<!--    where ot.PMS_OBJ_ID=#{objId} and ot.TRANSFORMER_ID = oe.PSRID-->
<!--    group by ot.COMPANY_NAME,ot.SUBSTATION_NAME,ot.TRANSFORMER_ID,ot.TRANSFORMER_NAME,oe.STARTDATE,oe.ENDDATE,ot.CAP-->
<!--    order by STARTDATE-->
<!--</select>-->
</body>
</html>